package com.lm.activiti.boot.cases.lambda;

import com.lm.activiti.boot.cases.lambda.inter.NoReturnNoParam;
import org.junit.Test;

import java.util.function.Function;

/**
 * @author lm_jcf
 * @date 2020/5/14 16:25
 */
public class LambdaTest {

    @Test
    public void lambda_(){
        NoReturnNoParam noReturnNoParam = (a, b) -> System.out.println(a + b);
        noReturnNoParam.method(1, 2);
    }

    public static void main(String[] args) {

        System.out.println(testFunction(2, integer -> integer * 2 + 1));
    }

    public static int testFunction(int i, Function<Integer, Integer> function) {
        return function.apply(i);
    }
}
